package com.c.service.impl;

import com.c.pojo.dto.UserDto;
import com.c.service.UserService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author bysun
 */
@Service
@CacheConfig(cacheNames = "users")
public class UserServiceImpl implements UserService {

    @Override
    @Cacheable
    public UserDto getUser(Integer id) {
        System.out.println("getUser");
        UserDto userDto = new UserDto(1, "张三");
        return userDto;
    }
}
